package cn.gtv.sdk.dcas.api;

import android.content.Context;
import android.content.SharedPreferences;

public class EncryptionKeyStorageManager {
    private final static String SP_DCAS_SDK="SP_DCAS_SDK";
    private final static String SP_DCAS_SDK_E_KEY="SP_DCAS_SDK_E_KEY";
    public static void saveKey(Context context,String key){
        SharedPreferences sp=context.getSharedPreferences(SP_DCAS_SDK,Context.MODE_PRIVATE | Context.MODE_MULTI_PROCESS);
        SharedPreferences.Editor editor = sp.edit();
        editor.putString(SP_DCAS_SDK_E_KEY,key);
        editor.commit();
    }

    public static String getKey(Context context){
        SharedPreferences sp=context.getSharedPreferences(SP_DCAS_SDK,Context.MODE_PRIVATE | Context.MODE_MULTI_PROCESS);
        return sp.getString(SP_DCAS_SDK_E_KEY,"");
    }

}
